﻿using System;
using System.Web.Mvc;
using GuRenFang.Service.IBiz;

namespace GuRenFang.Controllers.WebSite
{
    [ErrorHanderFilter]
    public class HomeController : Controller
    {
        private readonly IPhotosBiz _photosService;
        private readonly IContentInfoBiz _contentInfoService;

        public HomeController(IPhotosBiz photosService, IContentInfoBiz contentInfoBiz)
        {
            _photosService = photosService;
            _contentInfoService = contentInfoBiz;
        }

        public ActionResult Index()
        {
            //throw new Exception("safsafafd");
            return View(_photosService.GetItemsByPagesForHomePage(1, 10));
        }

        public ActionResult AboutUs()
        {
            return View(_contentInfoService.GetCompanyInfo());
        }

        [OutputCache(Duration = 3600)]
        public PartialViewResult _Tips()
        {
            return PartialView(_contentInfoService.GetTipsInfo());
        }

       
        public ActionResult Error()
        {
            return View();
        }
    }
}
